
//个人报表接口选择事件
$("#g1_c").change(function(){
		if(!$(this).prop("checked")){
			 $("td[my=a]").each(function() {  
				 $(this).hide();
				 $("input[name=Fruit]").attr("checked",false);
				 $(this).attr("checked",false);
   			 }); 
			
		}else{
			 $("td[my=a]").each(function() {  
        		$(this).attr("disabled",false);  
        		$(this).show();
   			 }); 
		}
	})	

	
$("#g201_c").change(function(){
	if($(this).prop("checked")){
		$("#files").attr("style","display:black");
	}else{
		$("#files").attr("style","display:none");
	}
})
	
$("#g501_c,#g503_c").change(function(){
	if($(this).prop("checked")){
		$("#card_c").attr("style","display:black");
	}else{
		$("#card_c").attr("style","display:none");
	}
});
$("#g502_c,#g6_c").change(function(){
	if($(this).prop("checked")){
		$("#card_c").attr("style","display:black");
		$("#phone_c").attr("style","display:black");
	}else{
		$("#card_c").attr("style","display:none");
		$("#phone_c").attr("style","display:black");
	}
});

$("#g7_c").change(function(){
	if($(this).prop("checked")){
		$("#card_c").attr("style","display:black");
	}else{
		$("#card_c").attr("style","display:none");
	}
});

$("#g11_c").change(function(){
	if($(this).prop("checked")){
		$("#phone_c").attr("style","display:black");
		$("#company_c").attr("style","display:black");
		$("#address_c").attr("style","display:black");
	}else{
		$("#phone_c").attr("style","display:none");
		$("#company_c").attr("style","display:none");
		$("#address_c").attr("style","display:none");
		
	}
});

$("#g1302_c").change(function(){
	if($(this).prop("checked")){
		$("#idlist_c").attr("style","display:black");
	}else{
		$("#idlist_c").attr("style","display:none");
	}
});

	

//企业服表系统接口选择事件
$("#b1_B").change(function(){
	if($(this).prop("checked")){
		$("#keyType_b").attr("style","display:black");
	}else{
		$("#keyType_b").attr("style","display:none");
	}
});
$("#b4_B").change(function(){
	if($(this).prop("checked")){   //typeId
		$("#idlist").attr("style","display:black");
		$("#typeId").attr("style","display:black");
	}else{
		$("#idlist").attr("style","display:none");
		$("#typeId").attr("style","display:none");
	}
});
$("#b402_B").change(function(){
	if($(this).prop("checked")){   //typeId
		$("#idlist").attr("style","display:black");
		$("#typeId").attr("style","display:black");
		$("#idgg_b").attr("style","display:black");
	}else{
		$("#idlist").attr("style","display:none");
		$("#typeId").attr("style","display:none");
		$("#idgg_b").attr("style","display:none");
	}
});

$("#b5_B").change(function(){
	if($(this).prop("checked")){
		$("#card_b").attr("style","display:black");
		$("#bankCode_b").attr("style","display:black");
	}else{
		$("#card_b").attr("style","display:none");
		$("#bankCode_b").attr("style","display:black");
	}
});


//处理时间
	

		function getSmpFormatDate(date, isFull) {
			var pattern = "";
			if (isFull == true || isFull == undefined) {
				pattern = "yyyy-MM-dd hh:mm:ss";
			} else {
				pattern = "yyyy-MM-dd";
			}
			return getFormatDate(date, pattern);
		}

		Date.prototype.format = function(format) {
			var o = {
				"M+" : this.getMonth() + 1,
				"d+" : this.getDate(),
				"h+" : this.getHours(),
				"m+" : this.getMinutes(),
				"s+" : this.getSeconds(),
				"q+" : Math.floor((this.getMonth() + 3) / 3),
				"S" : this.getMilliseconds()
			}
			if (/(y+)/.test(format)) {
				format = format.replace(RegExp.$1, (this.getFullYear() + "")
						.substr(4 - RegExp.$1.length));
			}
			for ( var k in o) {
				if (new RegExp("(" + k + ")").test(format)) {
					format = format.replace(RegExp.$1,
							RegExp.$1.length == 1 ? o[k] : ("00" + o[k])
									.substr(("" + o[k]).length));
				}
			}
			return format;
		}
		function getSmpsormatDateByLong(l, isFull) {
			return getSmpFormatDate(new Date(l), isFull);
		}

		function getFormatDate(date, pattern) {
			if (date == undefined) {
				date = new Date();
			}
			if (pattern == undefined) {
				pattern = "yyyy-MM-dd hh:mm:ss";
			}
			return date.format(pattern);
		}
		
		
		function p_extend(temp, data) {
			for ( var key in temp) {
				if ((data[key] == undefined) || (data[key] == "")) {
					data[key] = temp[key];
				}
				if (($.type(data[key]) == "object")
						|| ($.type(data[key]) == "array")) {
					p_extend(temp[key], data[key]);
				}
			}
			return data;
		}

		function checkval() {
			var s = "";
			var obj = $("input[name='Fruit']");
			for (var i = 0; i < obj.length; i++) {
				if (obj[i].checked) {
					s += obj[i].value + '~'; //如果选中，将value添加到变量s中
				}
			}
			var kk = s.substring(0, s.length - 1);
			return kk;
		}
		function checkval2() {
			var arr = "";
			var obj = $("input[name='Fruit']");
			for (var i = 0; i < obj.length; i++) {
				if (obj[i].checked) {
					arr = arr + obj[i].value + ","; //如果选中，将value添加到变量s中
				}
			}
			arr = arr.substring(0, arr.length - 1).split(",");
			return arr;
		}
		
		
		//处理时间
		template.helper("dateFormat", function (str, new_str) {
			if(str==""){
				new_str=" ";
			}else{
				var longTime = parseInt(str);
				new_str =  getSmpFormatDate(new Date(longTime), false);
			}
			
			return new_str;
		});